#!/usr/bin/env python

import re, sys

def validate_email(email):
	# Validate email address syntax
	if not re.match("^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$", email):
		print "Error: Invalid email address"
		sys.exit(1)

def email_configured(config):
	if "from_addr" and "smtp_host" and "smtp_port" in config:
		return True
	return False

def smtp_auth(config):
	if "smtp_user" and "smtp_pass" in config:
		return True
	return False
	
if __name__ == "__main__":
	
	config = {}
	
	config['smtp_user'] = "spam"
	config['smtp_pass'] = "eggs"
	
	auth = smtp_auth(config)
	
	print auth